#include "mcu_wdt.h"
#include "mcu.h"




void Wdt_Init()
{
    WRITE_REG(IWDG->KR, IWDG_KEY_ENABLE);
    WRITE_REG(IWDG->KR, IWDG_KEY_WRITE_ACCESS_ENABLE);

    while (IWDG->SR != RESET);

    IWDG->PR = WDG_CLK_DIV;
    IWDG->RLR = WDG_COUNT_VALUE;

    WRITE_REG(IWDG->KR, IWDG_KEY_RELOAD);
}








